#!/usr/bin/python
#CursesDisplay -- Display wrapper for curses python

import curses

class CursesDisplay:
        def __init__(self):
		self.stdscr = curses.initscr()
		curses.noecho()
		curses.raw()
		self.stdscr.keypad(1)

        def write_string(self, x, y, str):
		self.stdscr.addstr(y, x, str)
                
        def write_char(self, x, y, char):
		self.stdscr.addstr(y, x, str(char))
                
        def killme(self):
                self.stdscr.keypad(0)
		curses.nocbreak()
		curses.echo()
		curses.endwin()

        def getstr(self):
		return self.stdscr.getstr()
                
        def getch(self):
		return self.stdscr.getch()

	def refresh(self):
		self.stdscr.refresh()
